home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Files / Standard File / StandardGetFolder / Optimization.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.8 KB  |  87 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        Optimization.h
  3.     
  4.     Description:The Optimization changes to MoreFiles source and header files, along with
  5.                 this file and OptimizationEnd.h, let you optimize the code produced
  6.                 by MoreFiles in several ways.
  7.  
  8.                 1 -- MoreFiles contains extra code so that many routines can run under
  9.                 Mac OS systems back to System 6. If your program requires a specific
  10.                 version of Mac OS and your program checks for that version before
  11.                 calling MoreFiles routines, then you can remove a lot of compatibility
  12.                 code by defining one of the following to 1:
  13.     
  14.                 __MACOSSEVENFIVEONEORLATER    // assume Mac OS 7.5.1 or later
  15.                 __MACOSSEVENFIVEORLATER        // assume Mac OS 7.5 or later
  16.                 __MACOSSEVENORLATER            // assume Mac OS 7.0 or later
  17.  
  18.                 By default, all compatibility code is ON.
  19.     
  20.                 2 -- You may disable Pascal calling conventions in all MoreFiles routines
  21.                 except for system callbacks that require Pascal calling conventions.
  22.                 This will make C programs both smaller and faster.
  23.                 Just define __WANTPASCALELIMINATION to be 1 to turn this optimization on
  24.                 when building MoreFiles for use from C programs (you'll need to keep
  25.                 Pascal calling conventions when linking MoreFiles routines with Pascal
  26.                 programs).
  27.     
  28.                 3 -- If Metrowerks compiler is used, "#pragma internal on" may help produce
  29.                 better code. However, this option can also cause problems if you're
  30.                 trying to build MoreFiles as a shared library, so it is by default not used.
  31.                 Just define __USEPRAGMAINTERNAL to be 1 to turn this optimization on.
  32.  
  33.     Author:        FO
  34.  
  35.     Copyright:     Copyright: © 1992-1999 by Apple Computer, Inc.
  36.                 all rights reserved.
  37.     
  38.     Disclaimer:    You may incorporate this sample code into your applications without
  39.                 restriction, though the sample code has been provided "AS IS" and the
  40.                 responsibility for its operation is 100% yours.  However, what you are
  41.                 not permitted to do is to redistribute the source as "DSC Sample Code"
  42.                 after having made changes. If you're going to re-distribute the source,
  43.                 we require that you make it clear in the source that the code was
  44.                 descended from Apple Sample Code, but that you've made changes.
  45.     
  46.     Change History (most recent first):
  47.                 6/25/99    Updated for Metrowerks Codewarror Pro 2.1(KG)
  48.  
  49. */
  50.  
  51. #ifndef __MACOSSEVENFIVEONEORLATER
  52.     #define __MACOSSEVENFIVEONEORLATER 0
  53. #endif
  54.  
  55. #ifndef __MACOSSEVENFIVEORLATER
  56.     #define __MACOSSEVENFIVEORLATER __MACOSSEVENFIVEONEORLATER
  57. #endif
  58.  
  59. #ifndef __MACOSSEVENORLATER
  60.     #if GENERATINGCFM
  61.         #define __MACOSSEVENORLATER 1
  62.     #else
  63.         #define __MACOSSEVENORLATER __MACOSSEVENFIVEORLATER
  64.     #endif
  65. #endif
  66.  
  67.  
  68. #ifndef    __WANTPASCALELIMINATION
  69.     #define    __WANTPASCALELIMINATION    0
  70. #endif
  71.  
  72. #if    __WANTPASCALELIMINATION
  73.     #define pascal    
  74. #endif
  75.  
  76.  
  77. #ifndef __USEPRAGMAINTERNAL
  78.     #define    __USEPRAGMAINTERNAL    0
  79. #endif
  80.  
  81. #if    __USEPRAGMAINTERNAL
  82.     #if defined(__MWERKS__)
  83.         #pragma internal on
  84.     #endif
  85. #endif
  86.  
  87.